
#include "DataTypes.h"

template<> int PAIR<int>::minus_one = -1;
template<> float PAIR<float>::minus_one = -1;
template<> double PAIR<double>::minus_one = -1;

MPI_Datatype DataTypes::MPI_BLK_META_DATA = 0;

int DataTypes::init() {
  int count = 1;
  MPI_Datatype oldtypes = MPI_INT;
  MPI_Aint offsets = 0;
  int blockcounts = 6;

  if (MPI_Type_struct(1, &blockcounts, &offsets, &oldtypes,
	&MPI_BLK_META_DATA)!=MPI_SUCCESS) {
    printf("MPI_Type_struct failed!!!\n");
    return 0;
  }

  if (MPI_Type_commit(&MPI_BLK_META_DATA)!=MPI_SUCCESS) {
    printf("MPI_Type_commit failed!!!\n");
    return 0;
  }

  return 1;
}

